#include "stdafx.h"

BOOL CALLBACK MyMonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
	CArray<CRect>* pAry = reinterpret_cast<CArray<CRect>*>(dwData);
	CRect rc = *lprcMonitor;
	pAry->Add(rc);
	return TRUE; 
}

void GetDisplays(CArray<CRect>& disps)
{
	EnumDisplayMonitors(NULL,NULL,MyMonitorEnumProc,(LPARAM)(&disps));
}